<!-- html -->
<html>
	<body>
		<div>
			asdf
		</div>
	</body>
	<script type="text/javascript">
		if(window.WebSocket || WebSocket){
			console.log(window.path);
			var sk = new WebSocket('ws://:54213');
			sk.onconnection = function(event) { 
			  // 发送一个初始化消息
			  //sk.send('I am the client and I\'m listening!'); 

			  // 监听消息
			  sk.onmessage = function(event) { 
			    console.log('Client received a message',event); 
			  }; 

			  // 监听Socket的关闭
			  sk.onclose = function(event) { 
			    console.log('Client notified socket has closed',event); 
			  }; 

			  // 关闭Socket.... 
			  //sk.close() 
			};
		}else{
			alert('你这浏览器太低端了，都没有websocket....');
		}
	</script>
</html>